package com.hdoit.ares.web.official.modelconfig;
import com.hdoit.ares.web.official.providers.ArticalClassifyTreeProvider;
import com.hdoit.ares.web.official.providers.ArticalClassifyTypeProvider;
import com.tennetcn.common.enums.regular.MathRegularExpressions;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RegularExpressionAttribute;
import com.tennetcn.component.attribute.SwitchAttribute;
import com.tennetcn.component.attribute.TreeListAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;
import com.tennetcn.web.cbase.providers.YesOrNoSwitchProdiver;

/**
 * @author      yujinhui
 * @email       
 * @createtime  2018年01月09日 14:33:34
 * @comment
 */
public class ArticalClassifyConfig extends ModelMetadataAttributeConfiguration{
    public ArticalClassifyConfig(){
        this.setProperty("name")
            .hasAttribute(new DisplayNameAttribute("文章分类名称"));

        this.setProperty("title")
            .hasAttribute(new DisplayNameAttribute("标题"));

        this.setProperty("type")
            .hasAttribute(new DisplayNameAttribute("分类类型"))
            .hasAttribute(new DropDownListAttribute(new ArticalClassifyTypeProvider(),false));

        this.setProperty("parentId")
            .hasAttribute(new DisplayNameAttribute("父级"))
            .hasAttribute(new TreeListAttribute(new ArticalClassifyTreeProvider()));

        this.setProperty("remark")
            .hasAttribute(new DisplayNameAttribute("描述"));

        this.setProperty("keyword")
            .hasAttribute(new DisplayNameAttribute("关键字"));
        
        this.setProperty("functionURL")
        	.hasAttribute(new DisplayNameAttribute("方法访问路径"));
        
        this.setProperty("imgURL")
    	.hasAttribute(new DisplayNameAttribute("小图标"));

        this.setProperty("sortCode")
            .hasAttribute(new DisplayNameAttribute("排序字段"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("hidden")
            .hasAttribute(new DisplayNameAttribute("是否隐藏"))
            .hasAttribute(new SwitchAttribute(new YesOrNoSwitchProdiver()));

    }
}